home *** CD-ROM | disk | FTP | other *** search
- NEW! ReWritten! 2DeTogl Mod v2.0 1by 7Deltigar
- Deltigar #1 @8412
- Thu Dec 05 11:44:03 1991
- ┌────────────────────────────────────────────────────────────────────────────┐
- │ Mod Name: DeTogl Mod v2.0 Mod Author: Deltigar │
- │ Difficulty: Simple Date: 18 Nov 1991 │
- │ WWIV Version: 4.12, 4.20 Thanks to: Colossil Fossil, The Gatekeeper│
- │ Files Affected: utility.c, VARDEC.H, fcns.h, uedit.c(?) │
- │ │
- │ Description: This gives you 22 extra toggle bits to do whatever you │
- │ want to with. I also have included two functions to check the music and │
- │ funky_colors bits. The two main functions are easy. oktogl(int toggle) │
- │ checks the status of the new toggle bits 1 to 22. togl(int toggle) flips │
- │ the same bits. This simplifies a lot of other way to do it when writing │
- │ them into the code. │
- └────────────────────────────────────────────────────────────────────────────┘
- ┌────────────────────────────────────┐┌──────────────────────────────────────┐
- │ Example 1: ││ Example 2: │
- │ ││ │
- │ if (oktogl(5)) ││ if (!oktogl(5)) │
- │ togl(5); ││ togl(5); │
- │ ││ │
- │ This will always shut it off. ││ This will always turn it on. │
- │ ││ │
- └────────────────────────────────────┘└──────────────────────────────────────┘
-
- Discussion: There are several mods out there that require the addition
- of systatus bits to the userrec and if taken one at a time, this means
- altering vardec.h every time. There are also many small ideas that any
- sysop can think of that require the same thing, but are then deemed, too
- much for such a little thing. This mod is less of a mod than it is a tool
- for creative sysops. With ALL the systatus bits defined, the creative sysop
- can now do all the little silly things that before seemed to big, and,
- whenever one of those other major mods comes out, there is no need to alter
- vardec.h. A convenience most felt by those of us operating on older
- (slower) machines. Just as an example, how about setting a bit that tracks
- where the user logs of? Then log that user back where they left! With this
- installed, that becomes a minor piece of code!
-
- I will leave the rest up to you...
-
- New in Version 2! Completely rewritten routines. Much smaller, gets the
- job done better. I also added a test routine to help the installation. This
- was written by The gatekeeper and slightly modified by me.
-
-
- Here is the mod:
-
- In VARDEC.H ****************************************************
-
- /* userrec.sysstatus */
- #define sysstatus_ansi 0x0001
- #define sysstatus_color 0x0002
- #define sysstatus_music 0x0004
- #define sysstatus_pause_on_page 0x0008
- #define sysstatus_expert 0x0010
- #define sysstatus_smw 0x0020
- #define sysstatus_full_screen 0x0040
- #define sysstatus_nscan_file_system 0x0080
- #define sysstatus_funky_colors 0x0100
- #define sysstatus_clr_scrn 0x0200
- #define sysstatus_t_one 0x0400 /* DeTogl Mod */
- #define sysstatus_t_two 0x0800 /* DeTogl Mod */
- #define sysstatus_t_three 0x1000 /* DeTogl Mod */
- #define sysstatus_t_four 0x2000 /* DeTogl Mod */
- #define sysstatus_t_five 0x4000 /* DeTogl Mod */
- #define sysstatus_t_six 0x8000 /* DeTogl Mod */
- #define sysstatus_t_seven 0x00010000 /* DeTogl Mod */
- #define sysstatus_t_eight 0x00020000 /* DeTogl Mod */
- #define sysstatus_t_nine 0x00040000 /* DeTogl Mod */
- #define sysstatus_t_ten 0x00080000 /* DeTogl Mod */
- #define sysstatus_t_eleven 0x00100000 /* DeTogl Mod */
- #define sysstatus_t_twelve 0x00200000 /* DeTogl Mod */
- #define sysstatus_t_thirteen 0x00400000 /* DeTogl Mod */
- #define sysstatus_t_fourteen 0x00800000 /* DeTogl Mod */
- #define sysstatus_t_fifteen 0x01000000 /* DeTogl Mod */
- #define sysstatus_t_sixteen 0x02000000 /* DeTogl Mod */
- #define sysstatus_t_seventeen 0x04000000 /* DeTogl Mod */
- #define sysstatus_t_eighteen 0x08000000 /* DeTogl Mod */
- #define sysstatus_t_nineteen 0x10000000 /* DeTogl Mod */
- #define sysstatus_t_twenty 0x20000000 /* DeTogl Mod */
- #define sysstatus_t_twenty_one 0x40000000 /* DeTogl Mod */
- #define sysstatus_t_twenty_two 0x80000000 /* DeTogl Mod */
-
-
- In UTILITY.C *************************************************
-
- Add These:
-
-
- int oktogl(int toggle)
- {
- /* This will return the status of any one of 22 bits.
- (The Gatekeeper #1 @2461) */
- if (thisuser.sysstatus & ( 1L << (toggle +9) ) )
- return(1);
- else
- return(0);
- }
-
-
- void togl(int toggle)
- {
- /* This function flips any one of 22 bits.
- (The Gatekeeper #1 @2461) */
- unsigned long bit;
-
- bit = 1L << (toggle+9);
- if ( thisuser.sysstatus & bit )
- thisuser.sysstatus ^= bit;
- else
- thisuser.sysstatus |= bit;
- }
-
-
- int okmusic()
- /* This function checks the status of the current user's record to see if
- * the user has specified that he wants ANSI Music.
- */
- {
- if (thisuser.sysstatus & sysstatus_music)
- return(1);
- else
- return(0);
- }
-
- int okfunky()
- /* This function checks the status of the current user's record to see if
- * the user has specified that he wants Extended Colors.
- */
- {
- if (thisuser.sysstatus & sysstatus_funky_colors)
- return(1);
- else
- return(0);
- }
-
- DONE? *************************************************************
-
- Not yet... Update FCNS.H.
-
- int oktogl(int toggle);
- void togl(int toggle);
- int okmusic();
- int okfunky();
-
-
- Now, in uedit.c, I use the folowing for the display:
-
-
- if (u->sysstatus & sysstatus_t_fifteen)
- prt(5,"15");
-
-
- and in the void uedit, make your case selection here:
-
- prt(2,"Uedit : ");
- if ((realsl==255) || (wfc))
- ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAI~$!B:");
- else
- ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAI~$:");
- switch(ch) {
-
-
- and here is an example case statement:
-
- case '!':
- if (u.sysstatus & sysstatus_t_fifteen){
- u.sysstatus ^= sysstatus_t_fifteen;
- write_user(un,&u);
- break;
- }
-
-
- In Uedit, I only add those bits which I want to be able to alter. There
- are plenty of times when this is not needed, so I don't bother putting them
- here. This will have to be your own choice.
- Now! Your done. Add some stuff that uses some of your new toggles.
-
-
- NOTE:
- I use funky and music for different things on my board, so I don't have a
- set function to toggle them except the funky_colors toggle in the defaults
- and a copy of the same that I altered for music.
-
- Here is a stretch of code to help test the installation of this mod:
-
- in bbs.c void mainmenu:
-
- if (strcmp(s,"TOGL TEST")==0) {
- outchr(12);
- for ( i = 1 ; i < 23 ; i++ ) {
- printf("DeTogl bit %2d is %3s", i, (oktogl(i))?"ON":"OFF" );
- nl();
- }
- pausescr();
- outchr(12);
- for ( i = 0 ; i < 32 ; i++ ) {
- printf("SysStatus bit %2d is %3s", i, (thisuser.sysstatus&(1L<<i))?"ON":"OFF");
- nl();
- }
- }
-
-
-
- HONORABLE MENTION:
- The Black Dragon #1 @3080 (Gatekeeper's was shorter)
- The Emporer #1 @6470 (I couldn't get it to work for me)
-
-
- 3╘──══╡ 7Deltigar @8412 3╞══──╛
- 0 Soon to be:
- 3╘──══╡ 7Deltigar @8306 3╞══──╛
-
- 7░▒▓█5 WWIVnet Origin:1 Pocket Universe7 Suffolk, VA2 (804)934-8589 3Snarfable 7█▓▒░0